package designmodel.handler.raiseSalary;

import java.text.MessageFormat;

/**
 * 经理
 *
 * @author scylla
 * @version V1.0
 * @project echo-java-base
 * @title HR
 * @package designmodel.handler.raiseSalary
 * @since 2022/5/19 6:24 下午
 */
public class CommonLeader extends AbstractManager {


    public CommonLeader(String name) {
        super(name);
    }

    @Override
    public void doApproval(OARequest oaRequest) {
        String oaType = oaRequest.getOaType();
        int num = oaRequest.getNum();
        if (QINGJIA.equalsIgnoreCase(oaType)) {

            if (num > 1 && num <= 3) {
                System.out.println(MessageFormat.format("CommonLeader 审批通过,准予休假！{0} OA申请通过", oaRequest.toString()));
            } else doNext(oaRequest);

        } else if (JIAXIN.equalsIgnoreCase(oaType)) {

            if (num > 1000 && num <= 2000) {
                System.out.println(MessageFormat.format("CommonLeader 审批通过,可以调薪！{0} OA申请通过", oaRequest.toString()));
            } else doNext(oaRequest);

        } else {
            System.out.println("暂不支持此类OA申请。");
        }

    }
}
